Skip to content

Conversation

@jialinli98
Copy link
Contributor

@jialinli98 jialinli98 commented Jan 13, 2026

Description

When message size is given, there is no need to use cache to track absorb vs squeeze.

Problem*

Resolves

Summary*

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@jialinli98 jialinli98 requested a review from TomAFrench January 13, 2026 09:05
Comment on lines +69 to +74
for i in 0..in_len {
state[i % RATE] += input[i];
if (i + 1) % RATE == 0 {
state = crate::poseidon2_permutation(state, 4);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in a followup but I'd like to explore us partially unrolling this so that we writes into the state array 4 at a time to avoid needing to do so many modulos.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jialinli98 jialinli98 merged commit 211d4e9 into master Jan 14, 2026
7 checks passed
@jialinli98 jialinli98 deleted the jl/remove_cache branch January 14, 2026 05:50
@noirwhal noirwhal mentioned this pull request Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants